package a.a;

import a.c.bb;
import a.c.e;
import a.c.k;
import a.c.q;
import a.c.w;
import a.i.a.a;

import java.util.ArrayList;

class d
{
  private q a;
  private int[] b;
  private int[] c;
  private int[] d;
  private e e;
  private int[] f;
  private int[] g;
  private a.c.d[] h;
  private int[] i;
  private c_[] j;
  private b_ k;
  private boolean[] l;
  private c_ m;
  private int[] n;
  private int[] o;
  private int p;
  private int q;
  private boolean[] r;
  private int[] s;
  private int[] t;
  private int[] u;
  private a.c.d[] v;
  private int[] w;
  private int[] x;
  private ArrayList y;
  private ArrayList z;
  private b_[] A;
  private b_[] B;
  
  public int a(q paramq, a.c.x paramx, k paramk1, k paramk2)
  {
    return a(paramq, paramx, paramk1, paramk2, null, null, false, 9223372036854775807L);
  }
  
  public int a(q paramq, a.c.x paramx, k paramk1, k paramk2, long paramLong)
  {
    return a(paramq, paramx, paramk1, paramk2, null, null, false, paramLong);
  }
  
  public int a(q paramq, a.c.x paramx, k paramk1, k paramk2, k paramk3, e parame, boolean paramBoolean)
  {
    return a(paramq, paramx, paramk1, paramk2, paramk3, parame, paramBoolean, 9223372036854775807L);
  }
  
  public int a(q paramq, a.c.x paramx, k paramk1, k paramk2, k paramk3, e parame, boolean paramBoolean, long paramLong)
  {
    int i2 = m.b;
    boolean bool = m.a;
    if (i2 == 0)
    {
      if (paramq.k() < 1) {
        return 0;
      }
      if (i2 != 0) {}
    }
    else
    {
      if (paramq.k() != 1) {
        break label51;
      }
      paramx.a(paramq.p(), 0);
    }
    return 1;
    label51:
    long l1 = System.currentTimeMillis();
    this.a = paramq;
    a(paramx, paramk1, paramk2, paramBoolean, parame, paramk3, paramLong, l1);
    do
    {
      if (System.currentTimeMillis() - l1 >= paramLong) {
        break;
      }
      if (bool) {
        break label133;
      }
      a.c.d locald1;
      if ((i2 == 0) && ((locald1 = f()) == null)) {
        break;
      }
      a.c.d locald2 = a(locald1);
      b(locald1, locald2);
    } while (!bool);
    label133:
    int i1 = h();
    w localw = paramq.v();
    do
    {
      do
      {
        if (!localw.e()) {
          break;
        }
        paramx.a(localw.d(), this.d[localw.d().f()]);
        localw.f();
      } while (!bool);
    } while (i2 != 0);
    return i1;
  }
  
  private void a(a.c.x paramx, k paramk1, k paramk2, boolean paramBoolean, e parame, k paramk3, long paramLong1, long paramLong2)
  {
    int i6 = m.b;
    boolean bool = m.a;
    this.p = this.a.k();
    this.q = this.a.m();
    Object localObject2;
    if (i6 == 0)
    {
      this.b = new int[this.q];
      if (paramk1 == null) {}
    }
    else
    {
      a.c.m localm1 = this.a.w();
      do
      {
        if (!localm1.e()) {
          break;
        }
        localObject2 = localm1.a();
        this.b[localObject2.d()] = paramk1.getInt(localObject2);
        localm1.f();
        if ((i6 == 0) && (bool)) {
          break label178;
        }
      } while (!bool);
    }
    if (i6 == 0)
    {
      int i1 = 0;
      do
      {
        if (i1 >= this.b.length) {
          break;
        }
        this.b[i1] = 1;
        i1++;
        if ((i6 == 0) && (bool)) {
          break label178;
        }
      } while (!bool);
      if (i6 != 0) {
        break label306;
      }
      this.c = new int[this.q];
      label178:
      if (paramk2 != null)
      {
        a.c.m localm2 = this.a.w();
        do
        {
          if (!localm2.e()) {
            break;
          }
          localObject2 = localm2.a();
          this.c[localObject2.d()] = paramk2.getInt(localObject2);
          localm2.f();
          if (i6 != 0) {
            break label311;
          }
          if (bool) {
            break label309;
          }
        } while (!bool);
      }
    }
    if (i6 == 0)
    {
      int i2 = 0;
      do
      {
        if (i2 >= this.b.length) {
          break;
        }
        this.c[i2] = 1;
        i2++;
        if (i6 != 0) {
          break label311;
        }
        if (bool) {
          break label309;
        }
      } while (!bool);
      if (i6 == 0) {
        label306:
        this.d = new int[this.p];
      }
    }
    else
    {
      label309:
      if (paramBoolean)
      {
        label311:
        localObject1 = this.a.v();
        do
        {
          if (!((w)localObject1).e()) {
            break;
          }
          localObject2 = ((w)localObject1).d();
          if (i6 != 0) {
            break label443;
          }
          this.d[localObject2.f()] = paramx.getInt(localObject2);
          ((w)localObject1).f();
          if (bool) {
            break label442;
          }
        } while (!bool);
      }
      if (i6 == 0)
      {
        c();
        this.f = new int[this.p];
        this.g = new int[this.p];
        this.i = new int[this.p];
        this.h = new a.c.d[this.p];
      }
    }
    this.n = new int[this.q];
    label442:
    label443:
    this.o = ((i6 != 0) || (a()) ? new int[this.q] : null);
    if (i6 == 0)
    {
      this.m = new c_();
      if (parame == null)
      {
        this.e = this.a.v().d();
        if (i6 != 0) {
          break label543;
        }
        if (!bool) {
          break label521;
        }
      }
    }
    this.e = parame;
    label521:
    this.A = new b_[this.q];
    this.B = new b_[this.q];
    label543:
    Object localObject1 = this.a.w();
    do
    {
      if (!((a.c.m)localObject1).e()) {
        break;
      }
      localObject2 = ((a.c.m)localObject1).a();
      int i5 = ((a.c.d)localObject2).d();
      this.A[i5] = new b_(i5, (a.c.d)localObject2);
      this.B[i5] = new b_(i5, (a.c.d)localObject2);
      ((a.c.m)localObject1).f();
      if (i6 != 0) {
        break label653;
      }
      if (bool) {
        break label652;
      }
    } while (!bool);
    if (i6 == 0)
    {
      this.j = new c_[this.p];
      label652:
      label653:
      int i3 = 0;
      do
      {
        if (i3 >= this.j.length) {
          break;
        }
        this.j[i3] = new c_();
        i3++;
        if ((i6 == 0) && (bool)) {
          break label712;
        }
      } while (!bool);
      if (i6 == 0)
      {
        this.l = new boolean[this.q];
        label712:
        if (paramk3 != null)
        {
          a.c.m localm3 = this.a.w();
          while (localm3.e())
          {
            localObject2 = localm3.a();
            if ((i6 != 0) || (bool)) {
              break label871;
            }
            if (paramk3.getBool(localObject2)) {
              this.l[localObject2.d()] = true;
            }
            localm3.f();
          }
        }
        a(paramLong1);
        d();
        this.k = this.m.a;
      }
      this.r = new boolean[this.q];
      this.s = new int[this.p];
      this.u = new int[this.p];
      this.w = new int[this.q];
    }
    this.x = new int[this.q];
    this.v = this.a.u();
    label871:
    int i4 = 0;
    if (i4 < this.q) {}
    do
    {
      localObject2 = this.v[i4];
      this.w[i4] = ((a.c.d)localObject2).e().f();
      this.x[i4] = ((a.c.d)localObject2).f().f();
      i4++;
      if ((i6 == 0) && (bool)) {
        break label984;
      }
      if (!bool) {
        break;
      }
      this.y = new ArrayList(this.p);
      this.z = new ArrayList(this.p);
    } while (i6 != 0);
    this.t = new int[this.p];
    label984:
    long l1 = paramLong1 - System.currentTimeMillis() + paramLong2;
    if (l1 > 0L) {
      e();
    }
  }
  
  private boolean a()
  {
    boolean bool = m.a;
    int i1 = 0;
    int i2 = 0;
    do
    {
      if (i2 >= this.b.length) {
        break;
      }
      int i3 = this.b[i2];
      i1 += i3;
      if (bool) {
        break label49;
      }
      if (i1 < 0) {
        return true;
      }
      i2++;
    } while (!bool);
    label49:
    return false;
  }
  
  private void c()
  {
    int i2 = m.b;
    boolean bool = m.a;
    bb localbb = x.a(this.a);
    w localw = localbb.l();
    label147:
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale = localw.d();
      int i1 = this.d[locale.f()];
      a.c.m localm = locale.n();
      do
      {
        do
        {
          if (!localm.e()) {
            break label147;
          }
          a.c.d locald = localm.a();
          if (bool) {
            break;
          }
          if (i1 + this.c[locald.d()] > this.d[locald.f().f()]) {
            this.d[locald.f().f()] = (i1 + this.c[locald.d()]);
          }
          localm.f();
        } while (!bool);
        localw.f();
      } while (i2 != 0);
    } while (!bool);
  }
  
  private void a(long paramLong)
  {
    int i1 = m.b;
    boolean bool = m.a;
    cb localcb = new cb();
    localcb.a(this.a, this.d, this.c, paramLong);
    ArrayList localArrayList = new ArrayList();
    localArrayList.add(this.e);
    boolean[] arrayOfBoolean = new boolean[this.p];
    a.c.m[] arrayOfm = new a.c.m[this.p];
    Object localObject = this.a.v();
    do
    {
      if (!((w)localObject).e()) {
        break;
      }
      arrayOfm[localObject.d().f()] = ((w)localObject).d().l();
      ((w)localObject).f();
      if ((i1 == 0) && (bool)) {
        return;
      }
    } while (!bool);
    label143:
    label161:
    label316:
    label335:
    do
    {
      if ((i1 != 0) || (localArrayList.isEmpty())) {
        break;
      }
      localObject = (e)localArrayList.get(localArrayList.size() - 1);
      arrayOfBoolean[localObject.f()] = true;
      a.c.m localm = arrayOfm[localObject.f()];
      do
      {
        do
        {
          if (!localm.e()) {
            break label316;
          }
          a.c.d locald = localm.a();
          e locale = locald.a((e)localObject);
          if (bool) {
            break;
          }
          if (arrayOfBoolean[locale.f()] == 0)
          {
            if (i1 != 0) {
              continue;
            }
            if (this.d[locald.f().f()] - this.d[locald.e().f()] - this.c[locald.d()] == 0)
            {
              this.l[locald.d()] = true;
              if (i1 != 0) {
                break label335;
              }
              localArrayList.add(locale);
              if (!bool) {
                break label316;
              }
            }
          }
          localm.f();
        } while (!bool);
        if (i1 != 0) {
          break label161;
        }
        if (localArrayList.get(localArrayList.size() - 1) != localObject) {
          break;
        }
        if (i1 != 0) {
          break label143;
        }
        localArrayList.remove(localArrayList.size() - 1);
      } while (i1 != 0);
    } while (!bool);
  }
  
  private void d()
  {
    int i1 = m.b;
    boolean bool = m.a;
    ArrayList localArrayList = new ArrayList();
    localArrayList.add(this.e);
    boolean[] arrayOfBoolean = new boolean[this.p];
    a.c.m[] arrayOfm = new a.c.m[this.p];
    Object localObject = this.a.v();
    do
    {
      if (!((w)localObject).e()) {
        break;
      }
      arrayOfm[localObject.d().f()] = ((w)localObject).d().l();
      ((w)localObject).f();
      if ((i1 == 0) && (bool)) {
        return;
      }
    } while (!bool);
    label111:
    label127:
    do
    {
      if ((i1 != 0) || (localArrayList.isEmpty())) {
        break;
      }
      localObject = (e)localArrayList.get(localArrayList.size() - 1);
      arrayOfBoolean[localObject.f()] = true;
      a.c.m localm = arrayOfm[localObject.f()];
      do
      {
        do
        {
          if (!localm.e()) {
            break label305;
          }
          a.c.d locald = localm.a();
          e locale = locald.a((e)localObject);
          if (bool) {
            break;
          }
          if (arrayOfBoolean[locale.f()] == 0)
          {
            if (i1 != 0) {
              continue;
            }
            if (this.l[locald.d()] != 0)
            {
              b_ localb_ = this.A[locald.d()];
              localb_.d = locale.f();
              this.j[localObject.f()].a(localb_);
              this.h[locale.f()] = locald;
              this.m.a(this.B[locald.d()]);
              if (i1 != 0) {
                break label322;
              }
              localArrayList.add(locale);
              if (!bool) {
                break label305;
              }
            }
          }
          localm.f();
        } while (!bool);
        if (i1 != 0) {
          break label127;
        }
        if (localArrayList.get(localArrayList.size() - 1) != localObject) {
          break;
        }
        if (i1 != 0) {
          break label111;
        }
        localArrayList.remove(localArrayList.size() - 1);
      } while (i1 != 0);
    } while (!bool);
    label305:
    label322:
    return;
  }
  
  private void e()
  {
    int i2 = m.b;
    boolean bool = m.a;
    a(this.e, null, 1, 0);
    int i1 = this.a.k();
    a locala = new a(this.a, i1 + 1);
    w localw = this.a.v();
    label110:
    do
    {
      do
      {
        if (localw.e()) {
          break label110;
        }
        while (i2 != 0)
        {
          e locale = localw.d();
          locala.a(locale, i1 - this.i[locale.f()]);
          localw.f();
          if ((i2 == 0) && (bool)) {
            return;
          }
          if (!bool) {
            break;
          }
        }
        if (locala.a()) {
          break;
        }
        a(locala.c());
        if ((i2 == 0) && (bool)) {
          return;
        }
      } while (!bool);
    } while (i2 != 0);
    locala.e();
  }
  
  private void a(e parame)
  {
    int i4 = m.b;
    boolean bool = m.a;
    if (parame == this.e) {
      return;
    }
    a.c.d locald1 = this.h[parame.f()];
    int i1 = this.b[locald1.d()];
    int i2 = 0;
    d_ locald_ = new d_(null);
    a.c.d locald2;
    int i3;
    if (this.o == null)
    {
      localm = parame.l();
      label233:
      do
      {
        if (!localm.e()) {
          break;
        }
        locald2 = localm.a();
        i3 = locald2.d();
        if (bool) {
          break label539;
        }
        if (i4 == 0) {
          if (this.l[i3] != 0)
          {
            if (locald2 == locald1) {
              break label233;
            }
            if (i4 == 0)
            {
              if (a(locald2, locald1))
              {
                i1 += this.n[i3] - this.b[i3];
                if (i4 != 0) {
                  continue;
                }
                if (!bool) {
                  break label233;
                }
              }
              i1 += this.b[i3] - this.n[i3];
            }
            if (i4 != 0) {
              continue;
            }
            if (!bool) {
              break label233;
            }
          }
        }
        if (i4 == 0) {
          if (a(locald1, locald2))
          {
            i1 -= this.b[i3];
            if (i4 != 0) {
              continue;
            }
            if (!bool) {
              break label233;
            }
          }
        }
        i1 += this.b[i3];
        localm.f();
      } while (!bool);
    }
    a.c.m localm = parame.l();
    label433:
    label498:
    label510:
    label511:
    do
    {
      if (!localm.e()) {
        break;
      }
      locald2 = localm.a();
      i3 = locald2.d();
      if (bool) {
        break label539;
      }
      if (i4 == 0) {
        if (this.l[i3] != 0)
        {
          if (locald2 == locald1) {
            break label511;
          }
          if (i4 == 0)
          {
            if (a(locald2, locald1))
            {
              c(this.o[i3], this.n[i3], 0, this.b[i3], locald_);
              a(i2, i1, locald_.a, locald_.c, locald_);
              if (i4 != 0) {
                break label433;
              }
              if (!bool) {}
            }
            else
            {
              c(0, this.b[i3], this.o[i3], this.n[i3], locald_);
            }
          }
          else {
            a(i2, i1, locald_.a, locald_.c, locald_);
          }
          i2 = locald_.a;
          i1 = locald_.c;
          if (i4 != 0) {
            continue;
          }
          if (!bool) {
            break label511;
          }
        }
      }
      if (i4 == 0) {
        if (a(locald2, locald1))
        {
          c(i2, i1, 0, this.b[i3], locald_);
          if (i4 != 0) {
            break label510;
          }
          if (!bool) {
            break label498;
          }
        }
      }
      a(i2, i1, 0, this.b[i3], locald_);
      i2 = locald_.a;
      i1 = locald_.c;
      localm.f();
    } while (!bool);
    this.n[locald1.d()] = i1;
    if (i4 == 0) {
      label539:
      if ((i4 != 0) || (this.o != null)) {
        this.o[locald1.d()] = i2;
      }
    }
  }
  
  private boolean a(a.c.d paramd1, a.c.d paramd2)
  {
    return (m.b != 0) || ((paramd1.e() == paramd2.f()) || (paramd1.f() == paramd2.e()));
  }
  
  private void a(e parame1, e parame2, int paramInt1, int paramInt2)
  {
    c(parame1, parame2, paramInt1, paramInt2);
  }
  
  private void c(e parame1, e parame2, int paramInt1, int paramInt2)
  {
    int i10 = m.b;
    boolean bool = m.a;
    int i1 = 0;
    if (i10 == 0) {}
    int i2 = parame2 == null ? -1 : parame2.f();
    int i3 = parame1.f();
    int[] arrayOfInt1 = this.t;
    arrayOfInt1[0] = i3;
    int[] arrayOfInt2 = this.u;
    arrayOfInt2[i3] = 0;
    int[] arrayOfInt3 = this.c;
    c_[] arrayOfc_ = this.j;
    int[] arrayOfInt4 = this.d;
    a.c.d[] arrayOfd = this.h;
    int[] arrayOfInt5 = this.s;
    int[] arrayOfInt6 = this.g;
    int[] arrayOfInt7 = this.i;
    int[] arrayOfInt8 = this.f;
    int[] arrayOfInt9 = this.w;
    int[] arrayOfInt10 = this.x;
    int i4 = paramInt1;
    label379:
    do
    {
      do
      {
        int i5;
        int i6;
        do
        {
          if (i1 < 0) {
            return;
          }
          i5 = arrayOfInt1[i1];
          if (i10 != 0) {
            break label379;
          }
          if (arrayOfInt5[i5] % 2 != 0) {
            break;
          }
          i6 = arrayOfInt2[i5];
          arrayOfInt5[i5] += 1;
          arrayOfInt6[i5] = i4;
          arrayOfInt7[i5] = paramInt2;
          if (i10 == 0)
          {
            if (i5 == i2)
            {
              localObject = arrayOfd[i2];
              i7 = ((a.c.d)localObject).d();
              int i8 = arrayOfInt9[i7];
              int i9 = arrayOfInt10[i7];
              if (i10 == 0) {}
              i6 = i8 == i2 ? -arrayOfInt3[i7] - arrayOfInt4[i8] + arrayOfInt4[i9] : arrayOfInt3[i7] + arrayOfInt4[i8] - arrayOfInt4[i9];
            }
            arrayOfInt4[i5] += i6;
            paramInt2++;
          }
          localObject = arrayOfc_[i5].a;
        } while (localObject == null);
        tmp309_306 = ((b_)localObject).d;
        int i7 = tmp309_306;
        arrayOfInt2[tmp309_306] = i6;
        arrayOfInt1[(++i1)] = i7;
        Object localObject = ((b_)localObject).a;
        if ((i10 == 0) && (bool)) {
          return;
        }
        if (!bool) {
          break;
        }
        arrayOfInt5[i5] += 1;
        arrayOfInt8[i5] = (i4++);
        i1--;
        paramInt2--;
      } while (i10 != 0);
    } while (!bool);
  }
  
  private boolean a(a.c.d paramd, e parame)
  {
    if (m.b == 0) {}
    return !a(paramd, parame, this.e);
  }
  
  private boolean a(a.c.d paramd, e parame1, e parame2)
  {
    int i1 = paramd.f().f();
    int i2 = paramd.e().f();
    return a(i1, i2, parame1.f(), parame2.f());
  }
  
  private boolean a(int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    int i5 = m.b;
    if (i5 == 0) {
      if (this.f[paramInt1] > this.f[paramInt2])
      {
        i1 = this.f[paramInt2];
        i2 = this.g[paramInt2];
        if (i5 != 0) {
          break label74;
        }
        if (!m.a) {
          break label68;
        }
      }
    }
    int i1 = this.f[paramInt1];
    int i2 = this.g[paramInt1];
    label68:
    label74:
    int i3 = this.f[paramInt3];
    int i4 = this.f[paramInt4];
    if (i5 == 0) {
      if (i2 <= i3)
      {
        if (i5 != 0) {
          break label137;
        }
        if (i2 <= i4)
        {
          if (i5 != 0) {
            break label137;
          }
          if (i1 >= i3)
          {
            if (i5 != 0) {
              break label182;
            }
            if (i1 >= i4) {
              break label181;
            }
          }
        }
      }
    }
    label137:
    if (i5 == 0)
    {
      if (i2 <= i3)
      {
        if (i5 != 0) {
          break label184;
        }
        if (i1 >= i3) {
          break label183;
        }
      }
      if (i5 != 0) {}
    }
    else if (i2 <= i4)
    {
      if (i5 != 0) {
        break label184;
      }
      if (i1 >= i4) {
        break label183;
      }
    }
    label181:
    label182:
    return false;
    label183:
    label184:
    return true;
  }
  
  private e a(e parame1, e parame2, ArrayList paramArrayList, boolean[] paramArrayOfBoolean)
  {
    int i4 = m.b;
    boolean bool = m.a;
    int i1 = parame1.f();
    int i2 = parame2.f();
    this.z.clear();
    a.c.d locald2;
    a.c.d locald1;
    do
    {
      if (this.i[i1] < this.i[i2]) {}
      while (i4 != 0)
      {
        locald2 = this.h[i2];
        this.z.add(locald2);
        if (bool) {
          break label193;
        }
        paramArrayOfBoolean[locald2.d()] = (locald2.f() != parame2 ? 1 : false);
        parame2 = locald2.a(parame2);
        i2 = parame2.f();
        if (!bool) {
          break;
        }
      }
      if (this.i[i1] <= this.i[i2]) {
        break;
      }
      locald1 = this.h[i1];
      paramArrayList.add(locald1);
      if (bool) {
        break label242;
      }
      paramArrayOfBoolean[locald1.d()] = (locald1.e() != parame1 ? 1 : false);
      parame1 = locald1.a(parame1);
      i1 = parame1.f();
    } while (!bool);
    label193:
    label242:
    do
    {
      if ((i4 != 0) || (parame1 == parame2)) {
        break;
      }
      locald1 = this.h[i1];
      if (i4 == 0)
      {
        if (bool) {
          break label337;
        }
        paramArrayList.add(locald1);
      }
      paramArrayOfBoolean[locald1.d()] = (locald1.e() != parame1 ? 1 : false);
      parame1 = locald1.a(parame1);
      i1 = parame1.f();
      locald2 = this.h[i2];
      this.z.add(locald2);
      paramArrayOfBoolean[locald2.d()] = (locald2.f() != parame2 ? 1 : false);
      parame2 = locald2.a(parame2);
      i2 = parame2.f();
    } while (!bool);
    if (i4 == 0) {}
    label337:
    int i3 = this.z.size() - 1;
    do
    {
      while (!bool)
      {
        if (i3 < 0) {
          break;
        }
        paramArrayList.add(this.z.get(i3));
        i3--;
      }
    } while (i4 != 0);
    return parame1;
  }
  
  private a.c.d f()
  {
    int i2 = m.b;
    boolean bool = m.a;
    int[] arrayOfInt1 = this.n;
    int[] arrayOfInt2 = this.o;
    b_ localb_ = this.k;
    int i1 = 0;
    if (i1++ < this.p) {
      if ((i2 != 0) || (localb_ == null)) {
        localb_ = this.m.a;
      }
    }
    label127:
    do
    {
      if ((i2 != 0) || ((arrayOfInt2 != null) || ((i2 != 0) || (arrayOfInt1[localb_.c] >= 0))))
      {
        if ((i2 != 0) || (arrayOfInt2 != null))
        {
          if (i2 != 0) {
            break label127;
          }
          if (arrayOfInt2[localb_.c] >= 0) {}
        }
      }
      else
      {
        a.c.d locald = localb_.e;
        this.k = localb_.a;
        return locald;
      }
      localb_ = localb_.a;
      if (!bool) {
        break;
      }
      this.k = localb_;
    } while (i2 != 0);
    return null;
  }
  
  private a.c.d a(a.c.d paramd)
  {
    int i14 = m.b;
    boolean bool = m.a;
    int i1 = -1;
    int i2 = 2147483647;
    int i3 = paramd.e().f();
    int i4 = paramd.f().f();
    int[] arrayOfInt1 = this.f;
    int i5 = arrayOfInt1[i4];
    if (i14 == 0) {
      if (arrayOfInt1[i3] > arrayOfInt1[i4])
      {
        i6 = arrayOfInt1[i4];
        i7 = this.g[i4];
        if (i14 != 0) {
          break label104;
        }
        if (!bool) {
          break label106;
        }
      }
    }
    int i6 = arrayOfInt1[i3];
    label104:
    int i7 = this.g[i3];
    label106:
    int[] arrayOfInt2 = this.w;
    int[] arrayOfInt3 = this.x;
    int[] arrayOfInt4 = this.d;
    int[] arrayOfInt5 = this.c;
    int i8 = this.q - 1;
    label277:
    label353:
    label354:
    do
    {
      if (i8 < 0) {
        break;
      }
      int i9 = arrayOfInt2[i8];
      int i10 = arrayOfInt3[i8];
      int i11 = arrayOfInt4[i10] - arrayOfInt4[i9] - arrayOfInt5[i8];
      if (i14 == 0)
      {
        if (i2 > i11)
        {
          int i12 = arrayOfInt1[i9];
          int i13 = arrayOfInt1[i10];
          if (i14 == 0) {
            if (i7 <= i13)
            {
              if (i14 != 0) {
                break label277;
              }
              if (i6 >= i13)
              {
                if (i14 == 0) {
                  if (i7 <= i12)
                  {
                    if (i14 != 0) {
                      continue;
                    }
                    if (i6 >= i12) {
                      break label354;
                    }
                  }
                }
                if (i14 != 0) {
                  break label277;
                }
                if (i7 <= i5)
                {
                  if (i14 != 0) {
                    continue;
                  }
                  if (i6 >= i5) {
                    break label354;
                  }
                }
              }
            }
          }
          if (i14 == 0)
          {
            if (i7 <= i13)
            {
              if (i14 != 0) {
                break label353;
              }
              if (i6 >= i13) {}
            }
            else
            {
              if (i14 != 0) {
                continue;
              }
            }
          }
          else
          {
            if (i7 > i12) {
              break label354;
            }
            if (i14 != 0) {
              continue;
            }
            if (i6 < i12) {
              break label354;
            }
            if (i14 != 0) {
              continue;
            }
            if (i7 > i5) {
              break label354;
            }
            if (i14 != 0) {
              break label353;
            }
            if (i6 < i5) {
              break label354;
            }
          }
          i2 = i11;
          i1 = i8;
        }
        i8--;
      }
    } while (!bool);
    return this.v[i1];
  }
  
  private void b(a.c.d paramd1, a.c.d paramd2)
  {
    int i11 = m.b;
    boolean bool = m.a;
    this.y.clear();
    int i1 = paramd1.d();
    int i2 = paramd2.d();
    e locale3 = paramd2.e();
    e locale4 = paramd2.f();
    e locale1;
    if (a(paramd1, locale4))
    {
      locale1 = locale3;
      this.r[i2] = true;
      locale2 = a(locale3, locale4, this.y, this.r);
      if (i11 == 0) {
        if (!bool) {
          break label119;
        }
      }
    }
    else
    {
      locale1 = locale4;
      this.r[i2] = false;
    }
    e locale2 = a(locale4, locale3, this.y, this.r);
    label119:
    Object localObject1 = paramd2;
    int i3 = 1;
    int i4 = this.n[i1];
    if (i11 == 0) {}
    int i5 = this.o == null ? 0 : this.o[i1];
    int i6 = this.r[i1];
    int i7 = locale1.f();
    d_ locald_ = new d_(null);
    int i9;
    label280:
    int i10;
    b_ localb_;
    if (this.o == null)
    {
      i8 = 0;
      label382:
      do
      {
        if (i8 >= this.y.size()) {
          break;
        }
        localObject2 = (a.c.d)this.y.get(i8);
        i9 = ((a.c.d)localObject2).d();
        if (bool) {
          break label713;
        }
        if (this.r[i9] == i6)
        {
          this.n[i9] -= i4;
          if (i11 != 0) {
            break label280;
          }
          if (!bool) {}
        }
        else
        {
          this.n[i9] += i4;
        }
        if (i11 == 0)
        {
          if (i3 != 0)
          {
            this.h[i7] = localObject1;
            i10 = i7;
            locale1 = ((a.c.d)localObject2).a(locale1);
            i7 = locale1.f();
            localb_ = this.A[i9];
            this.j[i7].b(localb_);
            if (i11 == 0)
            {
              if (localObject2 != paramd1)
              {
                this.j[i10].a(localb_);
                localb_.d = i7;
              }
            }
            else
            {
              localObject1 = localObject2;
              if (i11 != 0) {
                continue;
              }
              if (!bool) {
                break label382;
              }
            }
            i3 = 0;
          }
          i8++;
        }
      } while (!bool);
    }
    int i8 = 0;
    if (i8 < this.y.size()) {}
    label525:
    label627:
    label632:
    do
    {
      localObject2 = (a.c.d)this.y.get(i8);
      i9 = ((a.c.d)localObject2).d();
      if (bool) {
        break label713;
      }
      if (this.r[i9] == i6)
      {
        c(this.o[i9], this.n[i9], i5, i4, locald_);
        if (i11 != 0) {
          break label525;
        }
        if (!bool) {}
      }
      else
      {
        a(this.o[i9], this.n[i9], i5, i4, locald_);
      }
      this.o[i9] = locald_.a;
      this.n[i9] = locald_.c;
      if (i11 == 0)
      {
        if (i3 != 0)
        {
          this.h[i7] = localObject1;
          i10 = i7;
          locale1 = ((a.c.d)localObject2).a(locale1);
          i7 = locale1.f();
          localb_ = this.A[i9];
          this.j[i7].b(localb_);
          if (i11 == 0)
          {
            if (localObject2 != paramd1)
            {
              this.j[i10].a(localb_);
              localb_.d = i7;
            }
          }
          else
          {
            localObject1 = localObject2;
            if (i11 != 0) {
              break label632;
            }
            if (!bool) {
              break label627;
            }
          }
          i3 = 0;
        }
        i8++;
      }
      if (!bool) {
        break;
      }
      if (i11 != 0) {
        break label700;
      }
    } while (i11 != 0);
    if (this.o == null)
    {
      if (i11 == 0) {}
      this.n[i2] = (this.r[i1] == this.r[i2] ? -i4 : i4);
      if (i11 != 0) {
        break label826;
      }
      if (!bool) {}
    }
    else
    {
      label700:
      if (this.r[i1] == this.r[i2])
      {
        label713:
        a(i5, i4, locald_);
        this.o[i2] = locald_.a;
        this.n[i2] = locald_.c;
        if (i11 != 0) {
          break label826;
        }
        if (!bool) {}
      }
      else
      {
        this.o[i2] = i5;
        this.n[i2] = i4;
      }
    }
    this.l[i1] = false;
    this.l[i2] = true;
    this.m.b(this.B[i1]);
    this.m.a(this.B[i2]);
    label826:
    i8 = locale2.f();
    Object localObject2 = this.A[i2];
    if (i11 == 0) {
      if (a(paramd1, locale3))
      {
        ((b_)localObject2).d = locale4.f();
        this.j[locale3.f()].a((b_)localObject2);
        a(locale2, locale4, this.g[i8], this.i[i8]);
        if (i11 == 0) {
          if (!bool) {
            return;
          }
        }
      }
      else
      {
        ((b_)localObject2).d = locale3.f();
        this.j[locale4.f()].a((b_)localObject2);
      }
    }
    a(locale2, locale3, this.g[i8], this.i[i8]);
  }
  
  private int h()
  {
    int i5 = m.b;
    boolean bool = m.a;
    int i1 = 2147483647;
    int i2 = -2147483647;
    int i4 = 0;
    do
    {
      do
      {
        if (i4 >= this.d.length) {
          break;
        }
        int i3 = this.d[i4];
        if (i5 != 0) {
          break label142;
        }
        if (bool) {
          break label141;
        }
        if (i3 < i1) {
          i1 = i3;
        }
        if (i5 == 0)
        {
          if (i3 > i2) {
            i2 = i3;
          }
          i4++;
        }
      } while (!bool);
    } while (i5 != 0);
    if (i5 == 0) {
      if (i1 != 0)
      {
        i4 = 0;
        do
        {
          do
          {
            if (i4 >= this.d.length) {
              break;
            }
            this.d[i4] -= i1;
            i4++;
            if (i5 != 0) {
              break label140;
            }
            if (bool) {
              break label139;
            }
          } while (!bool);
        } while (i5 != 0);
        i2 -= i1;
      }
    }
    label139:
    label140:
    label141:
    label142:
    return i2 + 1;
  }
  
  private void i()
  {
    int i2 = m.b;
    boolean bool2 = m.a;
    bb localbb = new bb();
    localbb.add(this.e);
    boolean bool1 = true;
    boolean[] arrayOfBoolean;
    Object localObject2;
    do
    {
      arrayOfBoolean = new boolean[this.p];
      while (localObject2 == null)
      {
        if (localbb.isEmpty()) {
          break;
        }
        localObject1 = localbb.o();
        arrayOfBoolean[localObject1.f()] = true;
        localObject2 = this.j[localObject1.f()].a;
      }
      a.c.d locald = this.v[localObject2.c];
      localbb.c(locald.a((e)localObject1));
      if ((i2 != 0) || ((i2 == 0) && ((bool2) || (bool2)))) {
        break label278;
      }
      if (this.h[locald.a(localObject1).f()] != locald)
      {
        bool1 = false;
        System.out.println("Parent inconsistent");
      }
      if (i2 == 0) {
        if (this.l[localObject2.c] == 0)
        {
          bool1 = false;
          System.out.println("treeEdge mark inconsistent");
        }
      }
      if (i2 == 0) {
        if (arrayOfBoolean[locald.a(localObject1).f()] != 0)
        {
          bool1 = false;
          System.out.println("Loop !");
        }
      }
      if (i2 == 0)
      {
        if (this.d[locald.f().f()] - this.d[locald.e().f()] - this.c[locald.d()] != 0)
        {
          bool1 = false;
          System.out.println("Slack int Tree != 0");
        }
        localObject2 = ((b_)localObject2).a;
      }
    } while (!bool2);
    label278:
    Object localObject1 = this.a.w();
    do
    {
      if (!((a.c.m)localObject1).e()) {
        break;
      }
      localObject2 = ((a.c.m)localObject1).a();
      if (bool2) {
        break label374;
      }
      if (this.d[localObject2.f().f()] - this.d[localObject2.e().f()] - this.c[localObject2.d()] < 0)
      {
        bool1 = false;
        System.out.println("Slack < 0");
      }
      ((a.c.m)localObject1).f();
    } while (!bool2);
    label374:
    int i1 = 0;
    do
    {
      while (!bool2)
      {
        if (i1 >= this.p) {
          break;
        }
        if (i2 == 0)
        {
          if (arrayOfBoolean[i1] == 0)
          {
            bool1 = false;
            System.out.println("Node not visited !");
          }
          i1++;
        }
      }
      System.out.println("Conistent:" + bool1);
    } while (i2 != 0);
  }
  
  private static void a(int paramInt1, int paramInt2, int paramInt3, int paramInt4, d_ paramd_)
  {
    int i1 = paramInt2 + paramInt4;
    int i2 = (paramInt2 & paramInt4 | (paramInt2 | paramInt4) & (i1 ^ 0xFFFFFFFF)) >>> 31;
    int i3 = paramInt1 + paramInt3 + i2;
    paramd_.a = i3;
    paramd_.c = i1;
  }
  
  private static void c(int paramInt1, int paramInt2, int paramInt3, int paramInt4, d_ paramd_)
  {
    int i1 = paramInt2 - paramInt4;
    int i2 = ((paramInt2 ^ 0xFFFFFFFF) & paramInt4 | (paramInt2 ^ paramInt4 ^ 0xFFFFFFFF) & i1) >>> 31;
    int i3 = paramInt1 - paramInt3 - i2;
    paramd_.a = i3;
    paramd_.c = i1;
  }
  
  private static void a(int paramInt1, int paramInt2, d_ paramd_)
  {
    int i1 = (paramInt2 ^ 0xFFFFFFFF) + 1;
    int i2 = ((paramInt2 ^ 0xFFFFFFFF) & (i1 ^ 0xFFFFFFFF)) >>> 31;
    int i3 = (paramInt1 ^ 0xFFFFFFFF) + i2;
    paramd_.a = i3;
    paramd_.c = i1;
  }
  
  static final class c_
  {
    public d.b_ a;
    public d.b_ c;
    
    public void a(d.b_ paramb_)
    {
      int i = m.b;
      paramb_.b = null;
      paramb_.a = null;
      if (i == 0)
      {
        if (this.c == null)
        {
          this.a = (this.c = paramb_);
          if (i == 0) {
            if (!m.a) {
              return;
            }
          }
        }
        else
        {
          this.c.a = paramb_;
        }
      }
      else {
        paramb_.b = this.c;
      }
      this.c = paramb_;
    }
    
    public void b(d.b_ paramb_)
    {
      int i = m.b;
      boolean bool = m.a;
      if ((i != 0) || (paramb_ != this.a))
      {
        if (i != 0) {
          break label52;
        }
        paramb_.b.a = paramb_.a;
        if (!bool) {}
      }
      else
      {
        this.a = paramb_.a;
      }
      label52:
      if ((i != 0) || (paramb_ != this.c))
      {
        paramb_.a.b = paramb_.b;
        if (!bool) {}
      }
      else
      {
        this.c = paramb_.b;
      }
    }
    
    public void a()
    {
      this.a = (this.c = null);
    }
  }
  
  static final class b_
  {
    b_ a;
    b_ b;
    final int c;
    int d;
    final a.c.d e;
    
    b_(int paramInt, a.c.d paramd)
    {
      this.c = paramInt;
      this.e = paramd;
    }
  }
  
  private static final class d_
  {
    int a;
    int c;
    
    private d_() {}
    
    d_(d.0 param0)
    {
      this();
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.a.d

 * JD-Core Version:    0.7.0.1

 */